﻿

namespace LxCFD
{
    public class SumMonitor : SumMonitorBase
    {
        public override void CalCellValue(FvZone selectedZone, double[] array, int taskIndex)
        {
            double sum = 0;
            selectedZone.InnerIndex.CellIDs.GetSeg(out int i1, out int endp1, taskIndex);
            for (; i1 < endp1; i1++)
            {
                sum += array[i1];
            }
            ThreadsMath.AddToSum(sum);
        }
        public override void CalFaceValue(FvZone selectedZone, FvThread selectedThread, double[] array, int taskIndex)
        {
            double sum = 0;
            selectedThread.ThreadIndex.CellIDs.GetSeg(out int i1, out int endp1, taskIndex);
            for (; i1 < endp1; i1++)
            {
                sum += array[i1];
            }
            ThreadsMath.AddToSum(sum);
        }
    }
}

